package com.finance_provider.controller;

import com.entity.Payment;
import com.finance_provider.service.PaymentService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: RinPromise
 * @Date: 2021/9/23 9:23
 */
@RestController
public class PaymentController {

    @Resource
    private PaymentService paymentService;

    @RequestMapping("/addPayment")
    Boolean addPayment(Payment payment){
        return paymentService.addPayment(payment);
    }

    @RequestMapping("/updatePayment")
    Boolean updatePayment(Payment payment){
        return paymentService.updatePayment(payment);
    }

    @RequestMapping("/updatePayment")
    List<Payment> queryPayment(Payment payment){
        return paymentService.queryPayment(payment);
    }

    @RequestMapping("/queryPaymentId/{id}")
    Payment queryPaymentId(@PathVariable("id") Long id){
        return paymentService.queryPaymentId(id);
    }

    @RequestMapping("/deletePaymentId/{id}")
    Boolean deletePaymentId(@PathVariable("id") Long id){
        return paymentService.deletePaymentId(id);
    }

}
